#ifndef DISPLAYDEV_H
#define DISPLAYDEV_H 

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <string.h>

typedef struct Screendev
{
	int fd;
	void *mptr;                  //显示屏映射
	unsigned int xres;
	unsigned int yres;
	unsigned int px;	         //色深   即每个像素用几个位数表示    该px是表示由几个字节表示，即（色深/8）
	unsigned int screensize;
	int floor;                  //第几块内存
	int floors;					//共几块内存				
	void *screens[5];
}screendev;

//初始化显示屏
screendev *init_screen(const char *device, int floors);

//释放空间
bool exit_screen(screendev *device);


//绘制一个像素
bool draw_pixel(screendev *device, int x, int y, unsigned int color);


//绘制一块
bool draw_rect(screendev *device, int x, int y, int w, int h, int *pixels);

#endif
